
class Dog {
    public String name;
    public String sex;
    public int age;
    public double weight;

    //狗叫/成员方法
    public void bark() {
        System.out.println("汪汪汪");
    }

    //摇尾巴
    public void wagTail() {
        System.out.println("尾巴摇来摇去");
    }

    //设置信息
    public void setInformation(String name,
                               String sex,
                               int age,
                               double weight) {
        this.name = name;
        this.sex = sex;
        this.age = age;
        this.weight = weight;
    }

    //打印
    public void printDog(Dog x) {
        System.out.println(x.name);
        System.out.println(x.sex);
        System.out.println(x.age);
        System.out.println(x.weight);
    }

}

class Test {
    //封装成员变量
    private String name;
    private  int age;

    //封装构建方法
    private Test(String name, int age) {
        this.name = name;
        this.age = age;
    }

    public Test() {
        System.out.println("封装构造方法");
    }

    //公开方法，用于获取信息
    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    //设置信息操作

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
public class Main {
    public static void main(String[] args) {
        Test test = new Test();
        test.setName("zhangsan");
        System.out.println(test.getName());
    }
    public static void main3(String[] args) {
        //导包方式1
        java.util.Scanner in = new java.util.Scanner(System.in);
        //

    }
//    public static void main(String[] args) {
//        int[][] a = new int[6][6];
//        for (int i = 0; i < 6; i++) {
//            a[1][0] = 1;
//            a[i][i] = 1;
//        }
//        for(int i = 2; i < 6; i++) {
//            for(int j = 1; j < i; j++) {
//                a[i][j] = a[i-1][j-1] + a[i-1][j];
//            }
//        }
//        for(int i = 0; i < 6; i++) {
//            for(int j = 0; j < j+1; j++) {
//                System.out.printf("%-3d",a[i][j]);
//            }
//            System.out.println();
//        }
//    }
    public static void main2(String[] args) {
        Dog dog = new Dog();
        dog.setInformation("文巧平","女",18,120.0);
        dog.printDog(dog);
        Date date = new Date(1990,1,1);

    }
    public static void main1(String[] args) {
        System.out.println("Hello world!");
    }
}